package com.bjpowernode.boss.convert;

import com.bjpowernode.boss.db.domain.PayProduct;
import com.bjpowernode.boss.db.domain.PayWay;
import com.bjpowernode.boss.web.models.vo.PayProductVo;
import com.bjpowernode.boss.web.models.vo.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface PayConvert {
    List<PayProductVo> toPayProductVos(List<PayProduct> payProducts);
    List<PayWayVo> toPayWayVos(List<PayWay> payWays);
    @Mappings({
            @Mapping(source = "editTime",target = "editTime",dateFormat = "yyyy-MM-dd HH:mm:ss")
    })
    PayProductVo toPayProductVo(PayProduct payProduct);
    @Mappings({
            @Mapping(source = "editTime",target = "editTime",dateFormat = "yyyy-MM-dd HH:mm:ss")
    })
    PayWayVo toPayWayVo(PayWay payWay);
}
